export const flyTo = (map, location) => {
  let center;

  if (location == "武汉") {
    center = [114.31, 30.52];
  } else if (location == "北京") {
    center = [116.46, 39.92];
  } else if (location == "上海") {
    center = [121.48, 31.22];
  } else if (location == "广州") {
    center = [113.23, 23.16];
  } else if (location == "深圳") {
    center = [114.07, 22.62];
  } else if (location == "成都") {
    center = [104.06, 30.67];
  } else if (location == "西安") {
    center = [108.94, 34.34];
  } else if (location == "长沙") {
    center = [112.98, 28.19];
  } else if (location == "重庆") {
    center = [106.54, 29.59];
  } else if (location == "天津") {
    center = [117.2, 39.13];
  } else if (location == "青岛") {
    center = [120.33, 36.07];
  } else if (location == "杭州") {
    center = [120.19, 30.26];
  } else if (location == "南京") {
    center = [118.78, 32.04];
  } else if (location == "郑州") {
    center = [113.65, 34.76];
  } else if (location == "济南") {
    center = [117.0, 36.65];
  }

  map.getView().animate({
    center: center,
    zoom: 12,
    duration: 2000,
  });
};
